package com.daxidi.cn.controller;
import com.daxidi.cn.dto.LoginDTO;
import com.daxidi.cn.service.UserService;
import com.daxidi.cn.vo.UserVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author JiaLin
 * create 2020-11-07
 */
@Api(tags = "jwt登录验证")
@RestController
@RequestMapping(value = "/api/v1/union/userTest")
@Slf4j
public class UserTestController {

    @Autowired
    private UserService userService;

    /**
     * 登录
     * @param loginDTO
     * @return
     */
    @ApiOperation(value = "用户登录接口")
    @PostMapping(value = "/login")
    public UserVO login(@RequestBody LoginDTO loginDTO){
        return userService.login(loginDTO);
    }

    @ApiOperation(value = "用户登录测试接口")
    @GetMapping(value = "/test")
    public String test(){
        return "success";
    }

}